package com.yanqu.road.entity.activity.pasture;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;

@FieldTypeAnnotation(tableName = "t_u_activity_pasture_user_data")
public class PastureUserData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "用户ID", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "最高积分")
    private long maxScore;

    @FieldTypeAnnotation(desc = "今日次数")
    private int todayTimes;

    @FieldTypeAnnotation(desc = "动物数据")
    private Map<Integer, PastureAnimalData> animalDataMap = new HashMap<>();

    @FieldTypeAnnotation(desc = "游戏模式数据")
    private PastureGameData gameData = new PastureGameData();

    @FieldTypeAnnotation(desc = "练习模式数据")
    private PastureGameData practiceData = new PastureGameData();

    @FieldTypeAnnotation(desc = "更新时间")
    private long updateTime;

    @FieldTypeAnnotation(desc = "重置时间")
    private long resetTime;

    @FieldTypeAnnotation(desc = "是否购买白银战令")
    private boolean isBuySilverToken;

    @FieldTypeAnnotation(desc = "是否购买黄金战令")
    private boolean isBuyGoldToken;

    @FieldTypeAnnotation(desc = "最近几步的游戏数据")
    private LinkedList<PastureGameData> recentStepsGameData = new LinkedList<>();

    @FieldTypeAnnotation(desc = "最近几步的练习模式游戏数据")
    private LinkedList<PastureGameData> recentStepsPracticeData = new LinkedList<>();

    @FieldTypeAnnotation(desc = "总游戏次数")
    private int gameCnt;

    @FieldTypeAnnotation(desc = "最高回合数")
    private int maxRound;

    @FieldTypeAnnotation(desc = "是否能复活")
    private boolean canRevive;

    @FieldTypeAnnotation(desc = "残局模板(索引)")
    private int practiceModelIdx;

    @FieldTypeAnnotation(desc = "上一次历史最高分")
    private long lastMaxScore;

    @FieldTypeAnnotation(desc = "是否完成引导")
    private boolean finishGuide;

    public PastureUserData() {

    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }


    public int getTodayTimes() {
        return todayTimes;
    }

    public void setTodayTimes(int todayTimes) {
        if (this.todayTimes != todayTimes) {
            this.todayTimes = todayTimes;
            setUpdateOption();
        }
    }

    public long getMaxScore() {
        return maxScore;
    }

    public void setMaxScore(long maxScore) {
        if (this.maxScore != maxScore) {
            this.maxScore = maxScore;
            setUpdateOption();
        }
    }

    public PastureGameData getGameData() {
        return gameData;
    }

    public void setGameData(PastureGameData gameData) {
        this.gameData = gameData;
        setUpdateOption();
    }

    public PastureGameData getPracticeData() {
        return practiceData;
    }

    public void setPracticeData(PastureGameData practiceData) {
        this.practiceData = practiceData;
        setUpdateOption();
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
        setUpdateOption();
    }

    public long getResetTime() {
        return resetTime;
    }

    public void setResetTime(long resetTime) {
        this.resetTime = resetTime;
    }

    public LinkedList<PastureGameData> getRecentStepsGameData() {
        return recentStepsGameData;
    }

    public void setRecentStepsGameData(LinkedList<PastureGameData> recentStepsGameData) {
        this.recentStepsGameData = recentStepsGameData;
        setUpdateOption();
    }

    public LinkedList<PastureGameData> getRecentStepsPracticeData() {
        return recentStepsPracticeData;
    }

    public void setRecentStepsPracticeData(LinkedList<PastureGameData> recentStepsPracticeData) {
        this.recentStepsPracticeData = recentStepsPracticeData;
        setUpdateOption();
    }

    public boolean isBuySilverToken() {
        return isBuySilverToken;
    }

    public void setBuySilverToken(boolean isBuySilverToken) {
        if (this.isBuySilverToken != isBuySilverToken) {
            this.isBuySilverToken = isBuySilverToken;
            setUpdateOption();
        }
    }

    public boolean isBuyGoldToken() {
        return isBuyGoldToken;
    }

    public void setBuyGoldToken(boolean isBuyGoldToken) {
        if (this.isBuyGoldToken != isBuyGoldToken) {
            this.isBuyGoldToken = isBuyGoldToken;
            setUpdateOption();
        }
    }

    public Map<Integer, PastureAnimalData> getAnimalDataMap() {
        return animalDataMap;
    }

    public void setAnimalDataMap(Map<Integer, PastureAnimalData> animalDataMap) {
        this.animalDataMap = animalDataMap;
        setUpdateOption();
    }

    public int getGameCnt() {
        return gameCnt;
    }

    public void setGameCnt(int gameCnt) {
        if (this.gameCnt != gameCnt) {
            this.gameCnt = gameCnt;
            setUpdateOption();
        }
    }

    public int getMaxRound() {
        return maxRound;
    }

    public void setMaxRound(int maxRound) {
        if (this.maxRound != maxRound) {
            this.maxRound = maxRound;
            setUpdateOption();
        }
    }

    public boolean isCanRevive() {
        return canRevive;
    }

    public void setCanRevive(boolean canRevive) {
        if (this.canRevive != canRevive) {
            this.canRevive = canRevive;
            setUpdateOption();
        }
    }

    public int getPracticeModelIdx() {
        return practiceModelIdx;
    }

    public void setPracticeModelIdx(int practiceModelIdx) {
        if (this.practiceModelIdx != practiceModelIdx) {
            this.practiceModelIdx = practiceModelIdx;
            setUpdateOption();
        }
    }

    public long getLastMaxScore() {
        return lastMaxScore;
    }

    public void setLastMaxScore(long lastMaxScore) {
        if (this.lastMaxScore != lastMaxScore) {
            this.lastMaxScore = lastMaxScore;
            setUpdateOption();
        }
    }

    public boolean isFinishGuide() {
        return finishGuide;
    }

    public void setFinishGuide(boolean finishGuide) {
        if (this.finishGuide != finishGuide) {
            this.finishGuide = finishGuide;
            setUpdateOption();
        }
    }
}
